package item.engine;

import java.util.Random;

public class RandomEngine {
	
	//creates a random engine based on level
	
	public static Engine random(int level) {
		
		Random r = new Random(); //number generator
		
		//initialize 
		
		int condition = r.nextInt(50) + 50;
		int weight = r.nextInt(10) + 5 * level;
		int speed = r.nextInt(50) + 200 * level;
		
		//compute cost
		
		int cost = (condition - weight * 5 + speed * 5) * level;
		
		//engine generated
		
		Engine e = new Engine(cost, condition, level, weight, speed);
		
		return e;
	}//end of method RandomEngine
}//end of class RandomEngine
